package com.zhaopin.gitlab;

import com.alibaba.fastjson.JSONObject;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Map;
import java.util.Objects;

public class Test4 {
    public static void main(String[] args) {
        String s = "//                convertInput().key(\"CV_USER_DESIRED_CITY_DISTRICT_SCORE\").value(getScoreDistrict(\"CV_USER_DESIRED_CITY_DISTRICT\", \"CV_USER_DESIRED_CITY1\")),";
        System.out.println(s.startsWith("////"));
    }

    static boolean compareDays(String time,String now,int days){
        String pattern = "yyyy-MM-dd'T'HH:mm:ss";
        time = time.substring(0,19);
        LocalDateTime from = LocalDateTime.parse(time, DateTimeFormatter.ofPattern(pattern));
        LocalDateTime localDateTime = from.plusDays(days);
        String format = localDateTime.format(DateTimeFormatter.ofPattern(pattern));
        if(pattern.compareTo(now) == 1){
            return true;
        }

        return false;
    }



    static boolean isAfterNow(String time, int days, String pattern , LocalDateTime now) {
        if (time != null) {
            time = time.substring(0,19);
            LocalDateTime from = LocalDateTime.parse(time, DateTimeFormatter.ofPattern(pattern));
            LocalDateTime localDateTime = from.plusDays(days);
            return localDateTime.isAfter(now);
        }
        return false;

    }

}
